package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.ReturnPresentMapper;
import com.qj.yantaishan.domain.ReturnPresent;
import com.qj.yantaishan.service.IReturnPresentService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 退货赠品Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class ReturnPresentServiceImpl    extends ServiceImpl<ReturnPresentMapper, ReturnPresent>  implements IReturnPresentService
{
    @Autowired
    private ReturnPresentMapper returnPresentMapper;

    /**
     * 查询退货赠品
     * 
     * @param id 退货赠品主键
     * @return 退货赠品
     */
    @Override
    public ReturnPresent selectReturnPresentById(Long id)
    {
        return returnPresentMapper.selectReturnPresentById(id);
    }

    /**
     * 查询退货赠品列表
     * 
     * @param returnPresent 退货赠品
     * @return 退货赠品
     */
    @Override
    public List<ReturnPresent> selectReturnPresentList(ReturnPresent returnPresent)
    {
        return returnPresentMapper.selectReturnPresentList(returnPresent);
    }

    /**
     * 新增退货赠品
     * 
     * @param returnPresent 退货赠品
     * @return 结果
     */
    @Override
    public int insertReturnPresent(ReturnPresent returnPresent)
    {
        return returnPresentMapper.insertReturnPresent(returnPresent);
    }

    /**
     * 修改退货赠品
     * 
     * @param returnPresent 退货赠品
     * @return 结果
     */
    @Override
    public int updateReturnPresent(ReturnPresent returnPresent)
    {
        return returnPresentMapper.updateReturnPresent(returnPresent);
    }

    /**
     * 批量删除退货赠品
     * 
     * @param ids 需要删除的退货赠品主键
     * @return 结果
     */
    @Override
    public int deleteReturnPresentByIds(String ids)
    {
        return returnPresentMapper.deleteReturnPresentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除退货赠品信息
     * 
     * @param id 退货赠品主键
     * @return 结果
     */
    @Override
    public int deleteReturnPresentById(Long id)
    {
        return returnPresentMapper.deleteReturnPresentById(id);
    }
}
